<module> <name>core</name> <script> <path>/core.js</path> </script> <depends> <module>base</module> </depends> </module>
We have seen previously that the name of a logical GateIn module translates into an AMD name with a prefix among SHARED, PORTLET or PORTAL. Thus a module is fully identified by its logical name and its scope. Scopes ensure that a module (and therefore the underlying web resource) is loaded at the right time when it is effectively required.
The module is related to a GateIn portal and should be loaded when the related portal is accessed:
<portal> <name>classic</name> <module> <script> <path>/classic.js</path> </script> <depends> <module>core</module> </depends> </module> </portal>
The module will be loaded when the corresponding portlet is accessed:
<portlet> <name>sitemap</name> <module> <script> <path>/sitemap.js</path> </script> <depends> <module>core</module> </depends> </module> </portlet>
A module can only depend on a shared module, therefore any depends tag implicitly refers to a shared module.